import request from "@/utils/request";

export function getRecordPage(query) {
  return request({
    url: "/cms/record/list",
    method: "get",
    params: query
  });
}

export function addRecord(obj) {
  return request({
    url: "/cms/record",
    method: "post",
    data: obj
  });
}

export function getRecord(id) {
  return request({
    url: "/cms/record/" + id,
    method: "get"
  });
}

export function delRecord(id) {
  return request({
    url: "/cms/record/" + id,
    method: "delete"
  });
}

export function putRecord(obj) {
  return request({
    url: "/cms/record",
    method: "put",
    data: obj
  });
}

export function batchRecord(obj) {
  return request({
    url: "/cms/record/batchInsert",
    method: "post",
    data: obj
  });
}

export function startExam(id) {
  return request({
    url: "/cms/record/startExam/" + id,
    method: "get"
  });
}

export function review(obj) {
  return request({
    url: `/cms/record/review?examId=${obj.examId}&userId=${obj.userId}`,
    method: "get"
  });
}
export function batchUpdate(obj) {
  return request({
    url: "/cms/record/batchUpdate",
    method: "post",
    data: obj
  });
}

export function exportExam(obj) {
  return request({
    url: `/cms/record/review/export/${obj.examId}`,
    method: "get"
  });
}

export function reset(examId) {
  return request({
    url: `/cms/record/reset/${examId}`,
    method: "get"
  });
}
export function correctionCompleted(examId) {
  return request({
    url: `/cms/record/correctionCompleted/${examId}`,
    method: "get"
  });
}
export function replicate(examId) {
  return request({
    url: `/cms/record/replicate/${examId}`,
    method: "get"
  });
}
